=head1 NAME

  RTx::AssetTracker::IP - an AssetTracker IP object

=head1 SYNOPSIS

  use RTx::AssetTracker::IP;

=head1 DESCRIPTION


=head1 METHODS

=begin testing 

use RTx::AssetTracker::IP;

=end testing

=cut


package RTx::AssetTracker::IP;

use strict;
no warnings qw(redefine);

# {{{ sub Create

=head2 Create

Create a new transaction.

This routine should _never_ be called anything other Than RTx::AssetTracker::Asset. It should not be called
from client code. Ever. Not ever.  If you do this, we will hunt you down. and break your kneecaps.
Then the unpleasant stuff will start.

TODO: Document what gets passed to this

=cut

sub Create {
    my $self = shift;
    my %args = (
        id             => undef,
        IP             => undef,
        Interface      => undef,
        MAC            => undef,
        Asset          => undef,
        @_
    );

    return $self->SUPER::Create(%args);

}

# {{{ sub Load

=head2 Load

Takes either a numerical id or a textual Name and loads the specified IP.

=cut

sub Load {
    my $self = shift;

    my $identifier = shift;
    if ( !$identifier ) {
        return (undef);
    }

    if ( $identifier =~ /^(\d+)$/ ) {
        $self->SUPER::LoadById($identifier);
    }
    else {
        $self->LoadByCols( IP => $identifier );
    }

    return ( $self->Id );

}

# }}}


1;
